package main

import "fmt"

type Cat struct {
	name string
	age  uint
}

type Bird struct {
	name string
	age  uint
}

type Action interface {
	Fly()
	Run()
}

func (c *Cat) Run() {
	fmt.Println("cat running...")
}

func (b *Bird) Fly() {
	fmt.Println("bird flying...")
}

func describe(i interface{}) {
	fmt.Printf("(%v, %T)\n", i, i)
}

func main() {
	cat := &Cat{"tom", 8}
	cat.Run()

	bird := &Bird{"mini", 6}
	bird.Fly()

	var i interface{}
	describe(i)

	i = 42
	describe(i)

	i = "hello world"
	describe(i)

	s1, ok := i.(string)
	fmt.Println(s1, ok)
	s2, ok := i.(uint)
	fmt.Println(s2, ok)
}
